<!--@if($module_srl)-->
<!--%load_js_plugin("ui.datepicker")-->
<h3>{$lang->dashboard->common->step} 2 : {$lang->dashboard->notice->write}</h3>

<div id="AdModule">
<div class="AdRegister">
    <form action="./" method="post" onsubmit="return procFilter(this, insert_notice)" id="fo_notice">
    <input type="hidden" name="vid" value="{$vid}" />
    <input type="hidden" name="mid" value="{$mid}" />
    <input type="hidden" name="module_srl" value="{$module_srl}" />
    <dl>
        <dd>{$lang->ad_content} : <input type="text" name="ad_content" value="" class="inputTypeText w400" /></dd>
        <dd>
            {$lang->start_date} :
            <input type="hidden" name="start_date" id="date_start" value="" />
            <input type="text" value="" readonly="readonly" class="inputDate inputTypeText" title="{$lang->about_start_date}" />
            <input type="text" name="start_hour" value="" class="inputTypeText w40" /> {$lang->hour}
            <input type="text" name="start_minute" value="" class="inputTypeText w40" /> {$lang->minute} 
            <input type="text" name="start_second" value="" class="inputTypeText w40" /> {$lang->second}
        </dd>
        <dd class="endDate">
            {$lang->end_date} :
            <input type="hidden" name="end_date" id="date_end" value="" />
            <input type="text" value="" readonly="readonly" class="inputDate inputTypeText" title="{$lang->about_end_date}" />
            <input type="text" name="end_hour" value="" disabled="disabled" class="inputTypeText w40" /> {$lang->hour}
            <input type="text" name="end_minute" value="" disabled="disabled" class="inputTypeText w40" /> {$lang->minute} 
            <input type="text" name="end_second" value="" disabled="disabled" class="inputTypeText w40" /> {$lang->second}
        </dd>
        <!--@if($module_info->use_time == 'Y')-->
        <dd class="adTime">
            {$lang->ad_time} :
                <!--@if(!count($module_info->ad_time_range))-->
                {@ $module_info->ad_time_range = $oAdModel->getDefaultAdTimeRange()}
                <!--@end-->
                {@ $AdTimeRange = explode(',',$module_info->ad_time_range)}
            <select name="ad_time" class="itemPicker">
                <!--@if($grant->manager)--><option value="-1">{$lang->unlimited}</option><!--@end-->
                <!--@if(is_array($AdTimeRange) && count($AdTimeRange)>0)-->
                <!--@foreach($AdTimeRange as $key => $val)-->
                <option value="{$val}">{$val}{$lang->time_word['hour']}</option>
                <!--@endforeach-->
                <!--@else-->
                <!--@end-->
            </select>
            <input type="checkbox" id="passiveAssign" class="passiveAssign" /> <label for="passiveAssign" title="광고 시간(종료일)을 직접 지정합니다." >직접 지정</label>
        </dd>
        <!--@end-->
        <dd class="AdOption">
            {$lang->ad_option} : 
            <input type="checkbox" name="used_style" id="use_bold" value="bold" /><label for="use_bold"><strong>{$lang->bold}</strong></label> 
            <input type="checkbox" name="used_style" id="use_underline" value="underline" /><label for="use_underline"><u>{$lang->underline}</u></label> 
            <input type="checkbox" name="used_style" id="use_italic" value="italic" /><label for="use_italic"><i>{$lang->italic}</i></label>
        </dd>
        <dd>
        {@ $AdColorRange = explode(',',$module_info->ad_color_range)}
            {$lang->text_color} :
			<select name="ad_color" class="colorPicker">
				<!--@foreach($AdColorRange as $key => $val)-->
				<option value="{$val}" style="color:{$val};background-color:{$val};">{$val}</option>
				<!--@endforeach-->
			</select>
		</dd>
		<dd>
		{@ $AdBgColorRange = explode(',',$module_info->ad_bgcolor_range)}
			{$lang->bg_color} :
			<select name="ad_bgcolor" class="colorPicker">
				<option value=""></option>
				<!--@foreach($AdBgColorRange as $key => $val)-->
				<option value="{$val}" style="color:{$val};background-color:{$val};">{$val}</option>
				<!--@endforeach-->
			</select>
		</dd>
		<dd>{$lang->url} : <input type="text" name="url" value="" class="inputTypeText w300" /></dd>
		<dd>
			{$lang->url_target} :
			<select name="url_target" class="itemPicker">
				<option value="_blank">{$lang->new_window}</option>
				<option value="_self">{$lang->current_window}</option>
			</select>
		</dd>
		<dd><a href="{getUrl('module_srl','')}" class="button"><span>{$lang->cmd_back}</span></a> <span class="button black"><input type="submit" value="{$lang->notice_reg}공지 등록" /></span></dd>
	</dl>
	</form>
</div>
</div>
<script type="text/javascript">
(function($){
    $('input.passiveAssign').click(function(){
        if($(this).attr('checked')) {
            $('.endDate').slideDown(125);
            $('.adTime select').fadeOut(250);
            $('.endDate input:disabled').attr('disabled', false);
            $('.adTime select:disabled').attr('disabled', true);
        } else {
            $('.endDate').slideUp(125);
            $('.adTime select').fadeIn(250);
            $('.endDate input:disabled').attr('disabled', true);
            $('.adTime select:disabled').attr('disabled', false);
        }
    });

    $(function(){
        var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', onSelect:function(){

            $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
        };
        $.extend(option,$.datepicker.regional['{$lang_type}']);
        $(".inputDate").datepicker(option);
    });
})(jQuery);
</script>
<!--@else-->
<h3>{$lang->dashboard->common->step} 1 : {$lang->dashboard->module->select}</h3>
<div class="infoText">{$lang->dashboard->desc->notice->select_module}</div>

<!-- 정보 -->
<div class="summary">
    <strong>Total</strong> <em>{number_format($total_count)}</em>, Page <strong>{number_format($page)}</strong>/{number_format($total_page)}
</div>

<!-- 목록 -->
<form action="./" method="get" onsubmit="return doChangeCategory(this);" id="fo_list">
<table cellspacing="0" class="listTable">
<thead>
    <tr>
        <th scope="col"><div>{$lang->no}</div></th>
        <th scope="col">
            <div>
                <input type="hidden" name="module" value="{$module}" />
                <input type="hidden" name="act" value="{$act}" />
                <select name="module_category_srl">
                    <option value="">{$lang->module_category}</option>
                    <option value="0" <!--@if($module_category_srl==="0")-->selected="selected"<!--@end-->>{$lang->not_exists}</option>
                    <!--@foreach($module_category as $key => $val)-->
                    <option value="{$key}" <!--@if($module_category_srl==$key)-->selected="selected"<!--@end-->>{$val->title}</option>
                    <!--@end-->
                    <option value="">---------</option>
                    <option value="-1">{$lang->cmd_management}</option>
                </select>
                <span class="button small"><input type="submit" value="GO" /></span>
            </div>
        </th>
        <th scope="col" class="half_wide"><div>{$lang->mid}</div></th>
        <th scope="col" class="half_wide"><div>{$lang->browser_title}</div></th>
        <th scope="col"><div>{$lang->regdate}</div></th>
        <th scope="col"><div>&nbsp;</div></th>
    </tr>
</thead>
<tbody>
    <!--@foreach($module_list as $no => $val)-->
    <tr>
        <td class="center number">{$no}</td>
        <td>
            <!--@if(!$val->module_category_srl)-->
                <!--@if($val->site_srl)-->
                {$lang->virtual_site}
                <!--@else-->
                {$lang->not_exists}
                <!--@end-->
            <!--@else-->
                {$module_category[$val->module_category_srl]->title}
            <!--@end-->
        </td>
        <td>{htmlspecialchars($val->mid)}</td>
        <td><a href="{getSiteUrl($val->domain,'','mid',$val->mid)}" onclick="window.open(this.href); return false;">{$val->browser_title}</a></td>
        <td>{zdate($val->regdate,"Y-m-d")}</td>
        <td><a href="{getUrl('act','dispAdAdminNoticeWrite','module_srl',$val->module_srl)}" class="buttonSet buttonActive" title="{$lang->cmd_select}"><span></span></a> {$lang->cmd_select}</td>
    </tr>
    <!--@end-->
</tbody>
</table>
</form>

<!-- 페이지 네비게이션 -->
<div class="pagination a1">
    <a href="{getUrl('page','','module_srl','')}" class="prevEnd">{$lang->first_page}</a> 
    <!--@while($page_no = $page_navigation->getNextPage())-->
        <!--@if($page == $page_no)-->
            <strong>{$page_no}</strong> 
        <!--@else-->
            <a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a> 
        <!--@end-->
    <!--@end-->
    <a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
<!--@end-->